package com.ruoyi.marry.util;

import com.ruoyi.common.utils.spring.SpringUtils;
import com.ruoyi.marry.domain.TMarryInfo;
import com.ruoyi.marry.service.ITMarryInfoService;

import java.util.List;

/**
 * @Author: lb
 * @Date: 2021/11/17 17:30
 * 公共参数获取类
 */
public class CommonConstant {

    /**
     * 获取小程序对应的恋人ID
     *
     * @return 恋人ID
     */
    public static Long getLoversId() {
        Long loversId = null;
        ITMarryInfoService tMarryInfoService = SpringUtils.getBean(ITMarryInfoService.class);
        List<TMarryInfo> infoList = tMarryInfoService.selectTMarryInfoListAll();
        if (infoList.size() > 0) {
            loversId = infoList.get(0).getLoversId();
        }
        return loversId;
    }
}
